import java.util.Scanner;

public class Program7 {
    public static void main(String[] args) {
        int word = 0,blank = 0,number = 0,other = 0;
        Scanner console = new Scanner(System.in);
        System.out.println("请输入一串字符：");
        String input = console.nextLine();
        char[] in = input.toCharArray();
        for (char c : in){
            if ((int)c > 64 && (int)c < 91){word += 1;}
            else if ((int)c > 96 && (int)c < 123){word += 1;}
            else if ((int)c > 47 && (int)c < 58){number += 1;}
            else if ((int)c == 32){blank += 1;}
            else {other += 1;}
        }
        System.out.println("该字符串有"+word+"个字母，"+blank+"个空格，"+number+"个数字，"+other+"个其他字符。");
    }
}